<template>
  <div id="login">
    <img id="logo" src="./assets/logo.png"/>
    <div>
      <el-input v-model="input" placeholder="用户名" name="username"></el-input>
      <el-input v-model="input" type="password" name="password" placeholder="密码"></el-input>
    </div>
    <div>
      <el-button type="primary" @click.native="login">登陆</el-button>
      <el-button type="primary" @click.native="regist">注册</el-button>
    </div>
  </div>
</template>

<script>
  export default {
    name: "Login", data() {
      return {}
    },
    methods: {
      login: function () {
        this.$api.post('/user/login', {
          "参数名": "参数值"
        }, response => {
          if (response.status >= 0 && response.status < 0) {
            console.log(response.data);
          } else {
            console.log(response.message);
          }
        });
  },
  regist:function () {
    this.$router.push('register');
  }
  }
  }
</script>

<style scoped>
  #logo {
  }

  .el-input {
    padding: 10px;
    width: 50%;
  }
</style>
